package com.hl.sfzy.service.impl;

import com.hl.sfzy.entity.Company;
import com.hl.sfzy.mapper.CompanyMapper;
import com.hl.sfzy.service.CompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CompanyServiceImpl implements  CompanyService{

    @Autowired
    private  CompanyMapper companyMapper;
    @Override
    public Company selectByPrimaryKey(Long companyId) {
        return companyMapper.selectByPrimaryKey(companyId);
    }

    @Override
    public int insert(Company company) {
        return companyMapper.insert(company);
    }

    @Override
    public int update(Company company) {
        return companyMapper.updateByPrimaryKeySelective(company);
    }

    @Override
    public int deleteByPrimaryKey(Long companyId) {
        return companyMapper.deleteByPrimaryKey(companyId);
    }

    @Override
    public int insertSelective(Company company) {
        return companyMapper.insertSelective(company);
    }

    @Override
    public int updateByPrimaryKeySelective(Company company) {
        System.out.println(companyMapper.updateByPrimaryKeySelective(company));
        return companyMapper.updateByPrimaryKeySelective(company);
    }

    @Override
    public int updateByPrimaryKey(Company company) {
        return companyMapper.updateByPrimaryKey(company);
    }

    public List<Company> selectAll() {
        return companyMapper.selectAll();
    }

}
